﻿using MySchool;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace MyKTV
{
    public partial class denglu : Form
    {
        Form1 F1 = new Form1();
        public denglu()
        {
            InitializeComponent();
        }

        private void ucBtnExt1_BtnClick(object sender, EventArgs e)
        {
            DBHelper db = new DBHelper();
            db.OpenConnection();
            DataSet set = new DataSet();
            if (this.textBoxEx1.Text.Equals(string.Empty) || this.textBoxEx2.Text.Equals(string.Empty))
            {
                MessageBox.Show("输入有误");
                return;
            }
            else
            {
                string sql = "select * from admin_info where admin_pwd='" + this.textBoxEx1.Text + "' and admin_name='" + this.textBoxEx2.Text + "'";
                SqlCommand comm = new SqlCommand(sql, db.Connection);

                int i = Convert.ToInt32(comm.ExecuteScalar());
                if (i > 0)
                {
                    F1.Show();
                    this.Hide();
                }



            }
        }

        private void ucBtnExt4_BtnClick(object sender, EventArgs e)
        {
            this.Close();
        }

        private void denglu_Load(object sender, EventArgs e)
        {
            this.textBoxEx1.Text = "1";
            this.textBoxEx2.Text = "1";
        }
    }
}
